﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BigPixels
{
    public class Sketch
    {
        public Sketch()
        {
            this.IsDirty = false;
        }

        public List<Cell> Load(string path)
        {
			List<Cell> cells = new List<Cell>();

			try
			{
				cells = BigPixelStorage.LoadCells(path);

				this.Path = path;
				this.IsDirty = false;
			}
			catch
			{
			}

            return cells;
        }

        public void Save(string path, List<Cell> cells)
        {
            BigPixelStorage.SaveCells(path, cells);
            this.Path = path;
            this.IsDirty = false;
        }

        public string Path
        {
            get;
            set;
        }

        public bool IsDirty
        {
            get;
            set;
        }

        public static string FileFilter
        {
            get
            {
                return "Sketch Files(*.xml)|*.xml|All files (*.*)|*.*";
            }
        }
    }
}
